#pragma once

#include "Applications/QtBaseApplication.h"
#include "MyTextItem.h"
#include <QWebView>
#include <QUrl>

namespace Blobz
{
	class QtKeyboard;
}

namespace QtTutorial5
{
	class QtTutorial5App : public Blobz::QtBaseApplication
	{
		Q_OBJECT
	public:
		QtTutorial5App();
		~QtTutorial5App();

	public:
		virtual bool onInitialize();
		virtual void onDeinitialize();

		virtual void onUpdate(float inFrameTime);
		virtual bool onEvent(QEvent *inEvent);

		virtual void onFingerDown(const TouchListener::TouchData& inData);
		virtual void onFingerUp(const TouchListener::TouchData& inData);
		virtual void onFingerUpdate(const TouchListener::TouchData& inData);
		virtual void onFingerExit(const TouchListener::TouchData& inData);

		virtual void paint(QPainter* inpPainter, const QStyleOptionGraphicsItem *inpOption, QWidget *inpWidget);

	public slots:
		void onItemsSizeSetup();

	private:
		float mCurrentScale;
		MyTextItem *mpTextItem;
		Blobz::QtKeyboard *mpKeyboard;
		QImage mBackground;
		QWebView* m_pWebView;
	};
}